/**
 * 
 */
package com.fr.util;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author 作者：Zhangyangyang
 * @version 创建时间：2017年1月18日 下午1:23:47 类说明:json数据输出工具类
 */
public class WriteResult {
	public static void backJson(String result, HttpServletRequest request, HttpServletResponse response) {
		//设置返回json编码格式
		response.setContentType("text/json; charset=utf-8");
		PrintWriter out = null;
		try {
			out = response.getWriter();
			result = result.replace("\\", "");
			out.print(result);
			out.flush();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if (out != null) {
				out.close();
			}
		}

	}
}
